home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Extensions / Macintosh Easy Open / Documentation / Developer / Interfaces / AIncludes / TranslationExtensions.a < prev   
Encoding:
Text File  |  1993-04-28  |  3.4 KB  |  116 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        TranslationExtensions.a
  3. ;
  4. ;    Contains:    Interface definitions for translation extension writers.
  5. ;    
  6. ;    Copyright:    © 1992-1993 by Apple Computer, Inc., all rights reserved.
  7. ;
  8. ;
  9.  
  10.     IF &TYPE('__INCLUDINGTRANSLATIONEXTENSIONS__') = 'UNDEFINED' THEN
  11. __INCLUDINGTRANSLATIONEXTENSIONS__    SET    1
  12.  
  13. _TranslationDispatch        opword    $ABFC        ; ••• move to traps.a
  14.  
  15.  
  16. ; special error codes that DoTranslateFile can return
  17. ;userCanceledErr            EQU        -128        ; user hit cancel button in progress dialog, or error handled by extension
  18. invalidTranslationPathErr    EQU        -3025        ; srcType to dstType is not a valid path         ••• move into Errors.a
  19. couldNotParseSourceFileErr    EQU        -3026        ; the source document does not contain srcType    ••• move into Errors.a
  20.  
  21. ; attribute bits for TranslationAttributes
  22. taDstDocNeedsResourceFork    EQU        1
  23. taDstIsAppTranslation        EQU        2
  24.  
  25.  
  26.  
  27. FileTypeSpec     RECORD 0
  28. format                DS.L    1                    ;    FileType
  29. hint                DS.L    1                    ;    LONGINT
  30. flags                DS.L    1                    ;    TranslationAttributes
  31. catInfoType            DS.L    1                    ;    OSType
  32. catInfoCreator        DS.L    1                    ;    OSType
  33. size                EQU        *
  34.                 ENDR        
  35.  
  36.  
  37. FileTranslationList    RECORD 0
  38. modDate                DS.L    1                    ;    LONGINT
  39. groupCount            DS.L    1                    ;    LONGINT
  40. ; group1SrcCount     DS.L    1 
  41. ; group1SrcEntrySize DS.L    1 = FileTypeSpec.size
  42. ; group1SrcTypes     DS        FileTypeSpec
  43. ; group1DstCount     DS.L    1 
  44. ; group1DstEntrySize DS.L    1 = FileTypeSpec.size
  45. ; group1DstTypes     DS        FileTypeSpec
  46. size                EQU        *
  47.                     ENDR
  48.                     
  49.  
  50. ScrapTypeSpec     RECORD 0
  51. format                DS.L    1                    ;    FileType
  52. hint                DS.L    1                    ;    LONGINT
  53. size                EQU        *
  54.                 ENDR        
  55.  
  56.  
  57. ScrapTranslationList    RECORD 0
  58. modDate                DS.L    1                    ;    LONGINT
  59. groupCount            DS.L    1                    ;    LONGINT
  60. ; group1SrcCount     DS.L    1 
  61. ; group1SrcEntrySize DS.L    1 = ScrapTypeSpec.size
  62. ; group1SrcTypes     DS        ScrapTypeSpec
  63. ; group1DstCount     DS.L    1 
  64. ; group1DstEntrySize DS.L    1 = ScrapTypeSpec.size
  65. ; group1DstTypes     DS        ScrapTypeSpec
  66. size                EQU        *
  67.                     ENDR
  68.  
  69.  
  70.  
  71. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  72. ;
  73. ; This routine sets the advertisement in the top half of the progress dialog.
  74. ; It is called once at the beginning of your DoTranslateFile routine.
  75. ;
  76. ; Enter:    refNum            Translation reference supplied to DoTranslateFile.
  77. ;            advertisement    A handle to the picture to display.  This must be non-purgable.
  78. ;                            Before returning from DoTranslateFile, you should dispose
  79. ;                            of the memory.  (Normally, it is in the temp translation heap
  80. ;                            so it is cleaned up for you.)
  81. ;
  82. ; Exit:        returns            noErr, paramErr, or memFullErr
  83. ;
  84. ;    FUNCTION SetTranslationAdvertisement( refNum        : TranslationRefNum;
  85. ;                                          advertisement    : PicHandle): OSErr;
  86.         MACRO
  87.         _SetTranslationAdvertisement
  88.         MOVEQ    #2,D0
  89.         _TranslationDispatch
  90.         ENDM
  91.  
  92.  
  93. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  94. ;
  95. ; This routine updates the progress bar in the progress dialog.
  96. ; It is only called from within your DoTranslateFile routine.
  97. ; It should be called often, so that the user will get feedback if he tries to cancel.
  98. ;
  99. ; Enter:    refNum        translation reference supplied to DoTranslateFile.
  100. ;            progress    percent complete (0-100)
  101. ;
  102. ; Exit:        canceled    TRUE if the user clicked the Cancel button, FALSE otherwise
  103. ;            returns        noErr, paramErr, or memFullErr
  104. ;
  105. ;    FUNCTION UpdateTranslationProgress( refNum        : TranslationRefNum;
  106. ;                                        percentDone    : INTEGER;
  107. ;                                    VAR canceled    : Boolean): OSErr;
  108.         MACRO
  109.         _UpdateTranslationProgress
  110.         MOVEQ    #1,D0
  111.         _TranslationDispatch
  112.         ENDM
  113.         
  114.     ENDIF    ; ...already included 
  115.     
  116.